package org.hyh.javaConfig;

import org.springframework.stereotype.Component;

import javax.annotation.PostConstruct;
import javax.annotation.PreDestroy;

/**
 * @auther :hyh
 * @desc :
 * @date :2019/12/12
 */
@Component     //用类名，当做bean 名称。
public class AStudent {

	private  String  name;

	@PostConstruct
	public  void  start() {
		System.out.println("我上学了");
	}


	@PreDestroy
	public  void  end() {
		System.out.println("我放学了");
	}


	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}


	@Override
	public String toString() {
		return "AStudent{" +
				"name='" + name + '\'' +
				'}';
	}
}
